import { createRouter, createWebHistory } from 'vue-router'

//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import RestManageVue from '@/views/rest/RestManage.vue'
import UserAvatarVue from '@/views/user/UserAvatar.vue'
import UserInfoVue from '@/views/user/UserInfo.vue'
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'
import UserManageVue from "@/views/user/UserManage.vue";
import AttendanceManagerVue from "@/views/attendance/AttendanceManager.vue";
import WeeklyreportVue from "@/views/weeklyreport/Weeklyreport.vue";

//定义路由关系
const routes = [
    { path: '/login', component: LoginVue },
    {
        path: '/', component: LayoutVue,redirect:'/rest/manage', children: [
            { path: '/attendance/manager', component: AttendanceManagerVue },
            { path: '/weeklyreport/manager', component: WeeklyreportVue },
            { path: '/rest/manage', component: RestManageVue },
            { path: '/user/manage', component: UserManageVue },
            { path: '/user/info', component: UserInfoVue },
            { path: '/user/avatar', component: UserAvatarVue },
            { path: '/user/resetPassword', component: UserResetPasswordVue }
        ]
    }
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router
